Skip to content

feat(mcp): logan_evidence_pack — one compact briefing, fetched first#31

Open
ozgesolidkey wants to merge 1 commit into
mainfrom
feat/evidence-pack-mcp
Open

feat(mcp): logan_evidence_pack — one compact briefing, fetched first#31
ozgesolidkey wants to merge 1 commit into
mainfrom
feat/evidence-pack-mcp

Conversation

@ozgesolidkey

Copy link
Copy Markdown
Contributor

Implements step 2 of docs/GRANULARIZATION_DESIGN.md: the evidence pack — one compact briefing the agent fetches first, so it works by-reference instead of dozens of exploratory round-trips.

What it adds

  • logan_evidence_pack MCP tool (src/mcp-server/index.ts) → POST /api/evidence-pack (src/main/api-server.ts).
  • Composes existing primitives in-process (no extra HTTP hops): analyze + detectTimeGaps + trendDiscoverFields + optional baseline compare.
  • Returns a small object: file/timeRange, severity + one-line summary (same rubric as logan_triage), level counts with error/warn %, crashes grouped by keyword (first viewerLine), top failing components, top time gaps (viewerLine + seconds), the discovered field vocabulary (name/type/occurrences/examples), filter hints, and an optional baselineDelta.
  • Everything is viewerLine references + counts, not raw log text, with caps truncation flags so a top-N never reads as "everything".
  • Analysis runs first, so a passed baselineId delta works in the same call.
  • Journaled as one replayable step (/api/evidence-pack added to INVESTIGATIVE_PATHS + a journalLabel branch).

Docs

  • docs/GRANULARIZATION_DESIGN.md — marked evidence-pack built, reordered build steps.
  • CLAUDE.md — added the tool to the Key MCP Tools table.

Verification

  • npm run build green (main + mcp-server dist emitted).
  • npm test — 319/319 pass.
  • Not yet exercised live in-app — reload LOGAN and call logan_evidence_pack on an open file to confirm the briefing shape before merge.

🤖 Generated with Claude Code

Adds a composed MCP tool + POST /api/evidence-pack endpoint that assembles
one small briefing from existing primitives (analyze + time-gaps +
trend-fields + optional baseline delta): severity, level counts, crashes
grouped by keyword, top failing components, top time gaps, the discovered
field vocabulary, and filter hints. Returns viewerLine references + counts
(with truncation flags), NOT raw log text — so the agent works by-reference
instead of dozens of exploratory round-trips.

- Server composes in-process via ctx.* calls (no extra HTTP hops); analysis
  runs first so an optional baselineId delta works in the same call.
- Journaled as one replayable investigation step (/api/evidence-pack).
- Implements step 2 of docs/GRANULARIZATION_DESIGN.md; doc + CLAUDE.md tool
  table updated to mark it built.

Build green, 319 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant